package cn.com.dcsgo.controller;

import cn.com.dcsgo.ProductFeignClient;
import cn.com.dcsgo.model.product.Category;
import cn.com.dcsgo.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * CategoryApiController
 *
 * @author Dcsgo
 * @since 2025/4/25 14:00
 */
@Api(tags = "商品分类")
@RestController
@RequestMapping("weixin/home")
@RequiredArgsConstructor
public class CategoryApiController {
    private final ProductFeignClient productFeignClient;

    @ApiOperation("获取所有分类信息")
    @GetMapping("category")
    public Result<List<Category>> getAllCategory() {
        return Result.ok(productFeignClient.getAllCategory());
    }
}
